package com.simple.chinagpay.api;

import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import retrofit2.Call;
import retrofit2.http.*;

import java.util.Map;

/**
 * @author yasud
 * @date 2021年03月09日 09:52
 * @description
 **/
public interface PayApi {

    @POST("/api/v2/standard/payment/moto/doPayment")
    @Headers({
            HttpHeaders.CONTENT_TYPE + ": " + MediaType.APPLICATION_JSON_VALUE
    })
    Call<ResponseBody> directPay(@Body RequestBody param);


    /**
     * 代付
     * @param body
     * @return
     */
    @POST("/api/v2/standard/remit/doRemit")
    @Headers(HttpHeaders.CONTENT_TYPE + ":" + MediaType.APPLICATION_JSON_VALUE)
    Call<ResponseBody> withdrawal(@Body Map<String, Object> body);

    /**
     * 跳转支付
     * @param body
     * @return
     */
    @FormUrlEncoded
    @POST("/api/v2/standard/payment/cashier/web/doPayment")
    Call<ResponseBody> redirectPay(@FieldMap Map<String, Object> body);


    /**
     * 查询代付
     * @param body
     * @return
     */
    @POST("/api/v2/standard/query/remit/remitQuery")
    @Headers(com.google.common.net.HttpHeaders.CONTENT_TYPE + ":" + MediaType.APPLICATION_JSON_UTF8_VALUE)
    Call<ResponseBody> queryAgentPay(@Body Map<String, Object> body);
}
